using System.Collections.Generic;
using UnityEngine;

namespace UFrame
{
    public static class OpenFunctionMa
    {
        public static List<OpenFunctionPOD> dataList = new List<OpenFunctionPOD>();

        public static bool IsOpen(int type)
        {
            foreach (var item in dataList)
            {
                if (item.type == type)
                {
                    return true;
                }
            }

            return false;
        }

        public static void SetFunctionState(int type, bool isOpen)
        {
            foreach (var item in dataList)
            {
                if (item.type == type)
                {
                    item.isOpen = isOpen;
                    return;
                }
            }

            Debug.LogError("没有找到功能类型");

        }


        public static void Add(OpenFunctionPOD data)
        {
            dataList.Add(data);
        }

        public static void Clear()
        {
            dataList.Clear();
        }


    }

    public class OpenFunctionPOD
    {
        public int type;
        public bool isOpen;
    }

}